import {useContext} from 'react';
import {GlobalDispatchContext, GlobalStateContext} from "@/redux/globalContext";

function useRedux(type = 'global') {
    const state = useContext(GlobalStateContext);
    const dispatch = useContext(GlobalDispatchContext);

    if (type === 'global') {
        return [state , dispatch];
    }else{
        //... context 模块化
    }

    return [state , dispatch];
}


export default useRedux;